//
//  panel.h
//  Void Dead
//
//  Created by Sidney Just on 04.07.09.
//  Copyright 2009 by Sidney Just
//  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; 
//  either version 3 of the License, or (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
//  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//  

#import <Foundation/Foundation.h>
#import <OpenGLES/ES1/gl.h>

@class VD_Vector;
@class VD_Engine;
@class VD_Animation;

/**
 * This class represents a panel on the screen!
 * Create panels through the VD_PanelManager provided by the VD_Engine, otherwise the panel will not be rendered!
 **/
@interface VD_Panel : NSObject {
	int layer;
	int texture;
	
	VD_Engine *renderEngine;
	
	BOOL animated;
	BOOL changeByCam;
	
	BOOL parallaxScrolled;
	
	BOOL visible;
	
	GLfloat pos_x, pos_y;
	VD_Vector *scale;
	VD_Vector *size;
	
	GLfloat atlasSize_x, atlasSize_y;
	GLfloat atlasPos_x, atlasPos_y;
	
	VD_Animation *animation;
	
	int skill_a;
	int skill_b;
	
	float rotation;
	
	void *userData;
}

/**
 * Checks if the Position is inside the panel
 @param pos_ The position to check
 @retun Yes if the Position is inside the panel
 **/
- (BOOL)posInMe:(CGPoint)pos_;

/**
 * Checks if the panel is visible (inside the screen)
 @retun Yes if the panel is visible
 **/
- (BOOL)isInScreenBounds;

/**
 * The roation in radian
 **/
@property float rotation;

/**
 * YES = The panel will be rendered, NO = The panel won't be rendered
 * Default: YES
 **/
@property BOOL visible;

/**
 * YES = If the panel will be moved through the camera, the movement will be multiplied with the panel layer. NO = The movement won't be multiplied with the layer
 * Default: NO
 **/
@property BOOL parallaxScrolled;

/**
 * Default: YES. YES = The panel is affected by the panelCamera_ vars
 **/
@property BOOL changeByCam;

/**
 * The layer of the panel
 **/
@property int layer;

/**
 * The texture of the panel
 **/
@property int texture;

/**
 * A skill where the user can store any integer data
 **/
@property int skill_a;

/**
 * A skill where the user can store any integer data
 **/
@property int skill_b;

/**
 * A pointer where the user can store any data.
 **/
@property void *userData;

/**
 * The animation of the panel. Animations can be shared with other panels
 **/
@property (nonatomic, assign) VD_Animation *animation;

/**
 * Yes if the panel is animated, No if the panel isn't animated (can be set manually, will be set when you assign a animation through the updatePan function)
 **/
@property BOOL animated;

/**
 * Position of the panel in screen coordinates
 **/
@property GLfloat pos_x, pos_y;

/**
 * Scale factor of the panel
 **/
@property (nonatomic, assign) VD_Vector *scale;

/**
 * The size in Pixel of the panel
 **/
@property (nonatomic, assign) VD_Vector *size;

/**
 * Position of the atlas
 **/
@property GLfloat atlasPos_x, atlasPos_y;

/**
 * Size of the atlas
 **/
@property GLfloat atlasSize_x, atlasSize_y;

@end
